package ca.ubc.icapture.genapha.forms;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;


/**
 * Created by IntelliJ IDEA.
 * User: btripp
 * Date: Sep 13, 2006
 * Time: 9:39:23 AM
 * To change this template use File | Settings | File Templates.
 */
public class FbatBinarizeForm extends AnalysisFilesForm
{

    private ArrayList<String> availableCutType;
    private String cutType;
    private String cutValue;

    public FbatBinarizeForm()
    {
        super();
        
        ArrayList<String> cutTypes = new ArrayList<String>();
        cutTypes.add("<=");
        cutTypes.add("<");
        cutTypes.add("=");
        cutTypes.add(">");
        cutTypes.add(">=");
        setAvailableCutType(cutTypes);
    }

    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request)
    {
        ActionErrors errors = new ActionErrors();

//       if(getSelectedPhenotype()!=null){
//           if(getSelectedPhenotype().length()==0)
//                errors.add("selectedPhenotype",new ActionMessage("error.entry.required"));
//       }
//
//       if(getCutValue()!=null){
//           if(getCutValue().length()==0)
//                errors.add("cutValue",new ActionMessage("error.entry.required"));
//       }
//
//       if(getSelectedCohort().length()==0)
//            errors.add("selectedCohort",new ActionMessage("error.entry.required"));
//       if(getEmail()!=null){
//           if(getEmail().length()==0)
//                errors.add("email",new ActionMessage("error.entry.required"));
//           else if(!getEmail().contains("@"))
//                errors.add("email",new ActionMessage("error.entry.invalid.email"));
//       }

        return errors;
    }

    /**
     * @return the availableCutType
     */
    public ArrayList<String> getAvailableCutType()
    {
        return availableCutType;
    }

    /**
     * @param availableCutType the availableCutType to set
     */
    public void setAvailableCutType(ArrayList<String> availableCutType)
    {
        this.availableCutType = availableCutType;
    }

    /**
     * @return the cutType
     */
    public String getCutType()
    {
        return cutType;
    }

    /**
     * @param cutType the cutType to set
     */
    public void setCutType(String cutType)
    {
        this.cutType = cutType;
    }

    /**
     * @return the cutValue
     */
    public String getCutValue()
    {
        return cutValue;
    }

    /**
     * @param cutValue the cutValue to set
     */
    public void setCutValue(String cutValue)
    {
        this.cutValue = cutValue;
    }
}
